﻿using System;

namespace TextEditor
{
    

    public class A_FontName : A_Action
    {
        public override string ActionName()
        {
            return "fontname";
        }

        public override A_Action Clone()
        {
            A_FontName name = new A_FontName();
            name.BaseCloneFrom(this);
            return name;
        }

        public override bool Execute()
        {
            base.myOwnerDocument.SetSelectioinFontName(base.Param1);
            return true;
        }

        public override string getStr
        {
            get
            {
                ZYTextChar preChar = base.myOwnerDocument.Content.GetPreChar();
                if (preChar != null)
                    return preChar.FontName;
                return "";
            }
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify();
        }
    }
}

